package org.prism.lists;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Lists {
    public static <iterator> void main(String[] args) {
        Collection<Integer> list = new ArrayList<>();
        list.add(4);
        list.add(1);
        list.add(3);
        list.add(2);

        for (Integer i : list) {
            System.out.println("i = " + i);
        }
        Iterator<Integer> iterator = list.iterator();
//        iterator.forEachRemaining();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
        System.out.println(Integer.MAX_VALUE);
    }
}
